<template>
	<div class="container">
		<div class="terminal-info-content" v-if="customData.agentName">
			<u-cell-item :arrow="false" hover-class="none" title="商户编号：" :value="customData.merchNo"><i
					slot="right-icon" class="iconfont icon-niantie" @click="copy(customData.merchNo)"></i></u-cell-item>
			<u-cell-item :arrow="false" hover-class="none" title="商户名称：" :value="customData.merchName" />
			<u-cell-item :arrow="false" hover-class="none" title="代理商编号：" :value="customData.agentNo"></u-cell-item>
			<u-cell-item :arrow="false" hover-class="none" title="代理商名称：" :value="customData.agentName" />
			<u-cell-item :arrow="false" hover-class="none" title="订单号：" :value="customData.orderNo"><i slot="right-icon"
					class="iconfont icon-niantie" @click="copy(customData.orderNo)"></i></u-cell-item>
			<u-cell-item :arrow="false" hover-class="none" title="机具sn号：" :value="customData.serialno"><i
					slot="right-icon" class="iconfont icon-niantie"
					@click="copy(customData.serialno)"></i></u-cell-item>

			<u-cell-item :arrow="false" hover-class="none" title="产品政策：" :value="customData.policyName" />

			<!--  <u-cell-item
        :arrow="false"
        hover-class="none"
        title="交易金额："
        :value="'￥' + toFixedNum(customData.amount)"
      /> -->
			<u-cell-item v-if="type!=7" :arrow="false" hover-class="none" title="金额："
				:value="'￥' + toFixedNum(customData.shareAmount)" />

			<!-- 通讯费扣费 -->
			<u-cell-item v-if="type==7" :arrow="false" hover-class="none" title="扣费金额："
				:value="'￥' + toFixedNum(customData.activeAmount)" />
			<u-cell-item :arrow="false" hover-class="none" title="账户类型：" :value="customData.walletName" />

			<u-cell-item :arrow="false" hover-class="none" title="交易日期：" :value="customData.transDate"
				class="agent-info-list-cell" />
			<block v-if="type!=0">
				<u-cell-item :arrow="false" hover-class="none" title="拓展1：" v-if="customData.expand1"
					:value="customData.expand1" />
				<u-cell-item :arrow="false" hover-class="none" title="拓展2：" v-if="customData.expand2"
					:value="customData.expand2" />
			</block>
		</div>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				navBarOptions: {
					title: "交易详情",
					router: {
						name: "trading"
					},
					backPrevPage: true,
				},
				customData: {},
				type: 0, //0:交易分润 , 1:伪激活查询 ,2: 达标查询 ,3:服务费查询, 4:通讯费查询
			};
		},
		onLoad(o) {
			this.type = o.type;
			let option = this.$storage.getStore("statisticsDetailInfo") || {};
			this.customData = option;
		},
		methods: {
			copy(value) {
				let _this = this;
				uni.setClipboardData({
					data: value,
					success: function() {
						_this.$tip.toast("复制成功!");
					},
				});
			},
			getCardType(tradInfo) {
				// if (tradInfo.transType) {
				return this.$options.filters["totalType"](
					tradInfo.transType,
					tradInfo.orderType
				);
				// } else if (tradInfo.tranType) {
				//   return  this.$options.filters["tranType"](tradInfo.tranType);
				// }
			},
			getCardType2(tradInfo) {
				if (tradInfo) {
					return this.$options.filters["cardType"](tradInfo.cardType);
				}
			},
		},
	};
</script>

<style lang="scss" scoped>
	.container {
		padding-top: R(20);
	}

	.terminal-info-content {
		margin: 0 R(20px);
		border-radius: R(20);
		background: #fff url(../../../common/images/newIcon/com-bg2.png) no-repeat;
		background-size: 100% auto;
	}
</style>